﻿<Window x:Class="SoftTeach.View.Personen.SelectSchülerDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:personenView="clr-namespace:SoftTeach.View.Personen" 
        xmlns:controls="clr-namespace:SoftTeach.Resources.Controls"
        Title="Frage ..." 
        Height="354" 
        Width="500" 
        ResizeMode="NoResize" 
        WindowStyle="SingleBorderWindow">
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition/>
      <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
    <controls:SmallDialogHeader Grid.Row="0" Title="Welche Schüler gehören zur Klasse?"
                                      Icon="/SoftTeach;component/Images/Schülerliste32.png"/>

    <Grid Grid.Row="1" Background="{x:Static SystemColors.MenuBarBrush}">

      <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
      </Grid.RowDefinitions>
      <StackPanel Grid.Row="0" Orientation="Horizontal">
        <Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Command="{Binding Path=AddPersonCommand}" 
                    ToolTip="Neue Person anlegen">
          <StackPanel Orientation="Horizontal">
            <Grid>
              <Image Source="/SoftTeach;component/Images/Person32.png"/>
              <Image Source="/SoftTeach;component/Images/AddOverlay32.png"/>
            </Grid>
            <!--<Label Padding="5,0,0,0" VerticalContentAlignment="Center">Neuen Stundenentwurf erstellen</Label>-->
          </StackPanel>
        </Button>
        <Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
                    Command="{Binding Path=DeletePersonCommand}" 
                    ToolTip="Aktuelle Person löschen.">
          <StackPanel Orientation="Horizontal">
            <Grid>
              <Image Source="/SoftTeach;component/Images/Person32.png"/>
              <Image Source="/SoftTeach;component/Images/RemoveOverlay32.png"/>
            </Grid>
            <!--<Label Padding="5,0,0,0" VerticalContentAlignment="Center">Stundenplanänderung eingeben</Label>-->
          </StackPanel>
        </Button>
        <Label VerticalAlignment="Center">Sortiert nach:</Label>
        <ComboBox SelectedValuePath="Content" SelectedValue="{Binding Path=SortByItem}" Margin="10"
                  Style="{StaticResource {x:Static ToolBar.ComboBoxStyleKey}}" MinWidth="100">
          <Label>Vorname</Label>
          <Label>Nachname</Label>
          <Label>Jahrgang</Label>
        </ComboBox>
      </StackPanel>
      <DataGrid Grid.Row="1" 
                Name="SchülerGrid"
                ItemsSource="{Binding Path=FilteredPersons}"
                SelectedItem="{Binding Path=CurrentPerson}" 
                AutoGenerateColumns="False" SelectionMode="Extended">
        <DataGrid.Columns>
          <DataGridTemplateColumn Header="Kurzinfo" Width="*">
            <DataGridTemplateColumn.CellTemplate>
              <DataTemplate>
                <TextBlock Text="{Binding Path=PersonKurzinfo}"/>
              </DataTemplate>
            </DataGridTemplateColumn.CellTemplate>
            <DataGridTemplateColumn.CellEditingTemplate>
              <DataTemplate>
                <personenView:PersonDetailView/>
              </DataTemplate>
            </DataGridTemplateColumn.CellEditingTemplate>
          </DataGridTemplateColumn>
        </DataGrid.Columns>
      </DataGrid>
    </Grid>
    <Grid Background="{StaticResource DefaultButtonsBackgroundBrush}" Grid.Row="2">
      <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="10">
        <Button Width="100" IsDefault="True" Click="OkClick" TabIndex="2">OK</Button>
        <Button Width="100" IsCancel="True" Click="CancelClick" TabIndex="2" Margin="10,0,0,0">Abbruch</Button>
      </StackPanel>
    </Grid>
  </Grid>
</Window>